package com.kasax.test.bc.ui.fragment

import android.view.View
import com.kasax.base.BasicBindingFragment
import com.kasax.test.bc.R
import com.kasax.test.bc.databinding.ActivityAndroidNetworkCommponentTestBinding
import com.kasax.test.bc.viewmodel.AndroidNetworkCompTestViewModel

class AndroidNetworkCommponentTestFragment : BasicBindingFragment<ActivityAndroidNetworkCommponentTestBinding>() {

    private val viewModel by lazy { AndroidNetworkCompTestViewModel() }

    override fun getLayoutId(): Int = R.layout.activity_android_network_commponent_test

    override fun addListeners(view: View) {
        viewBinding.btnGetipaddrTest.setOnClickListener { viewModel.testGetIpAddrWithHttpUrlConnection() }
        viewBinding.btnGettaobaipTest.setOnClickListener { viewModel.getToabaiIpWithHttpUrlConnection() }
        viewBinding.btnFromurlTest.setOnClickListener { viewModel.getFormUrlWithHttpUrlConnection() }
        viewBinding.btnJsonParamTest.setOnClickListener { viewModel.getJsonParamWithHttpUrlConnection() }
        viewBinding.btnXmlParamTest.setOnClickListener { viewModel.getXmlParamWithHttpUrlConnection() }
        viewBinding.btnGetbannersWithWanandroidapiTest.setOnClickListener { viewModel.testWanAndroidBanners() }
        viewBinding.btnLoginWithWanandroidapiTest.setOnClickListener { viewModel.testWanAndroidLogin() }
    }
}